import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class CommonPicker {
  static Future<int> showPicker(
      {BuildContext context, List<String> options, int value}) {
    return showCupertinoModalPopup(
        context: context,
        builder: (BuildContext context) {
          return Container(
              color: Colors.grey,
              height: 300,
              child: Column(
                children: [
                  Container(
                    color: Colors.white,
                      child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                        TextButton(
                            onPressed: () {},
                            child: Text("取消",style: TextStyle(color:Colors.green),)),
                        TextButton(onPressed: () {}, child: Text("确定",style:TextStyle(color:Colors.green),)),
                      ])),
                  Expanded(
                      child: CupertinoPicker(
                    itemExtent: 32.0,
                    onSelectedItemChanged: (val) {},
                    children: options.map((e) => Text(e)).toList(),
                  ))
                ],
              ));
        });
  }
}
